import { HEAD_DATA } from './actionTypes'
import axios from 'axios'

export const getHeaderData = () => async (dispatch) => {
  let resp = await axios({
    /*  method: 'post',
     url: 'http://localhost:3000/api',
     data: {
       url: 'http://i.waimai.meituan.com/ajax/v7/home/head',
       // url: 'https://h5.waimai.meituan.com/waimai/mindex/home',
       params: {
         not_need_primary_filter: false,
         userid: 280770501
       }
     } */
    method: 'get',
    url: './json/head.json',
  });

  dispatch({
    type: HEAD_DATA,
    obj: resp.data
  });

}
